﻿using ICSharpCode.SharpZipLib.GZip;
using NPortableExtensions;
using System;
using System.IO;

namespace Services4KouDai.Encrypt
{
    public class CommonDecompressor
    {
        public static Func<Stream, byte[]> GetDecompresssFunc()
        {
            return (Stream stream) =>
            {
                using (MemoryStream resultStream = new MemoryStream())
                {
                    using (GZipInputStream gzipStream = new GZipInputStream(stream))
                    {
                        return gzipStream.ToByteArray();
                    }
                }
            };
        }
    }
}
